/*
 * @Date: 2023-04-04 09:39:47
 * @LastEditTime: 2023-04-17 11:25:32
 */
import { UserLayout, BasicLayout } from '@/layouts'
import defaultSettings from './defaultSettings'

const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view')
}

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    redirect: '/project',
    component: BasicLayout,
    meta: { title: defaultSettings.title },
    children: [
      {
        path: '/project',
        name: 'project',
        redirect: '/project/list',
        component: RouteView,
        meta: { title: '系统管理', icon: 'home' },
        children: [
          {
            path: '/project/list',
            name: 'projectList',
            component: () => import('@/views/project/list.vue'),
            meta: { title: '项目管理' }
          },
          {
            path: '/string/list',
            name: 'stringList',
            component: () => import('@/views/string/index.vue'),
            meta: { title: '字符串管理' }
          },
          {
            path: '/translate/list',
            name: 'translateList',
            component: () => import('@/views/translate/index.vue'),
            meta: { title: '翻译管理' }
          }
        ]
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        meta: { title: '登录' },
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/login.vue')
      }
    ]
  },

  {
    path: '/404',
    meta: { title: '404' },
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
